package com.csqf.booksys.service.impl;

import java.util.List;

import com.csqf.booksys.dao.IBookDao;
import com.csqf.booksys.dao.impl.BookDaoImpl;
import com.csqf.booksys.entity.Book;
import com.csqf.booksys.entity.PageBean;
import com.csqf.booksys.service.IBookService;

/**
 * @author enbo.xie
 * @Date 2020年8月12日 下午4:43:18
 */
public class BookServiceImpl implements IBookService{
	IBookDao bookDaoImpl = new BookDaoImpl();
	
	@Override
	public int addBook(Book book) {
		return bookDaoImpl.insert(book);
	}

	@Override
	public int updBook(Book book) {
		return bookDaoImpl.update(book);
	}

	@Override
	public int delBook(int bid) {
		return bookDaoImpl.delete(bid);
	}

	@Override
	public Book findById(int bid) {
		return bookDaoImpl.select(bid);
	}

	@Override
	public List<Book> findByName(String name) {
		return bookDaoImpl.select(name);
	}

	@Override
	public List<Book> findAll() {
		return bookDaoImpl.select();
	}

	@Override
	public void findAll(PageBean<Book> pb) {
		bookDaoImpl.selectPage(pb);;
	}

}
